<template>
<onekit-page>
<onekit-view onekit-class="container">
	<div is="onekit-template-head" :DATA="`${JSON.stringify({title:'makePhoneCall'})}`"></div>
	<onekit-view onekit-class="page-body">
		<onekit-view onekit-class="page-section">
			<onekit-view onekit-class="desc">请在下方输入电话号码</onekit-view>
			<onekit-input onekit-class="input" type="number" name="input" @Input="bindInput"></onekit-input>
			<onekit-view onekit-class="btn-area">
				<onekit-button type="primary" :disabled="disabled" @Tap="makePhoneCall">拨打</onekit-button>
			</onekit-view>
		</onekit-view>
	</onekit-view>
	<div is="onekit-template-foot"></div>
</onekit-view>
</onekit-page></template>
<script>
/* eslint-disable */
import Vue from 'vue';
import onekit_template_0 from '../../../common/head.head.vue';Vue.component('onekit-template-head',onekit_template_0);
import onekit_template_1 from '../../../common/foot.foot.vue';Vue.component('onekit-template-foot',onekit_template_1);
const ONEKIT_JSON= {
  "navigationBarTitleText": "打电话",
  "usingComponents": {
    
  }
};
const ONEKIT_SJS = {
};
import wx from '../../../../weixin2vue/wx.js';
import Macro from '../../../../weixin2vue/Macro.js';
const {getApp,getCurrentPages} = Macro;
import Page from '../../../../weixin2vue/OnekitPage.js';
import Component from '../../../../weixin2vue/OnekitComponent.js';
export default Page(ONEKIT_JSON,["disabled"],ONEKIT_SJS,{
    "onShareAppMessage"(){
      return {
        "title":'打电话',
        "path":'packageAPI/pages/make-phone-call/make-phone-call'
};
    },
    "data":{
        "disabled":true
},
    "bindInput"(e){
      this.inputValue = e.detail.value;
      if(this.inputValue.length > 0)
      {
        this.setData({
            "disabled":false
});
      }
else
      {
        this.setData({
            "disabled":true
});
      };
    },
    "makePhoneCall"(){
      wx.makePhoneCall({
        "phoneNumber":this.inputValue,
        "success"(){
          console.log('成功拨打电话');
        }
});
    }
});

</script>
<style 
 lang="css">
.page-section {
  width: auto ;
  margin: 15px ;
  padding: 42px 30px 30px ;
  background-color: var(--weui-BG-2) ;
  font-size: 14px ;
}
.desc {
  margin-bottom: 10px ;
}
.input {
  height: 60px ;
  line-height: 60px ;
  font-size: 39px ;
  border-bottom: 1px solid var(--weui-FG-3) ;
}
.btn-area {
  padding: 0 ;
}
</style>